package com.yeyks.consumer.dal.dao;

import com.yeyks.common.result.UserStatisticalResult;
import com.yeyks.consumer.dal.domain.UserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeyks.consumer.dto.UserInfoResult;
import com.yeyks.consumer.param.UserInfo.UserInfoQueryByParentIdParam;
import com.yeyks.consumer.param.UserInfo.UserInfoQueryParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 * C端用户表 Mapper 接口
 * </p>
 *
 * @author yun
 * @since 2019-06-25
 */
public interface UserInfoMapper extends BaseMapper<UserInfo> {

    UserInfo selectUserInfoPhonePwd(@Param("phone") String phone, @Param("password") String password);

    Integer modifyPasswordById(@Param("id") Integer id, @Param("password") String password);

    Integer updateAvatar(@Param("id") Integer id, @Param("avatar") String avatar);

    Integer updateExtraInfoById(@Param("id") Integer id, @Param("extraInfo") String extraInfo);

    int deleteByPrimaryKey(Integer id);

    int insertSelective(UserInfo record);

    UserInfo selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(UserInfo record);

    int updateByPrimaryKey(UserInfo record);

    List<UserInfoResult> queryList(UserInfoQueryParam userInfoQueryParam);

    int queryListCount(UserInfoQueryParam userInfoQueryParam);

    UserInfo selectUserByCode(@Param("code") String code);

    List<UserStatisticalResult> statDay(@Param("day") Integer day);

    List<UserInfo> queryUserByParentIdPage(@Param("parentIdParam") UserInfoQueryByParentIdParam parentIdParam);

    Integer queryUserByParentIdCount(@Param("parentIdParam") UserInfoQueryByParentIdParam parentIdParam);

    /**
     * 查询子类集合
     * @param ids
     * @return
     */
    List<UserInfo> queryChildUser(@Param("ids") List<Integer> ids);
}
